package com.wg.dome.entity.config;

import com.wg.dome.attribute.AttributeType;
import com.wg.dome.entity.EquipType;
import com.wg.db.annotation.EntityField;
import com.wg.db.annotation.EntityTable;
import com.wg.db.schema.AccessLevel;

import java.io.Serializable;

/**
 * 装备
 */
@EntityTable(tableName = "static_init_equip", accessLevel = AccessLevel.ReadOnly)
public class InitEquipEntity implements Serializable {

    @EntityField(isKey = true)
    private int id;

    /**
     * 装备属性
     */
    @EntityField
    private int value;

    /**
     * 装备类型 , 1:武器，2:衣服 3:戒指 4:鞋子
     */
    @EntityField
    private byte kind;

    /**
     * 装备品质,1:蓝色  2:紫色  3:橙色
     */
    @EntityField
    private byte quality;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public byte getKind() {
        return kind;
    }

    public void setKind(byte kind) {
        this.kind = kind;
    }

    public byte getQuality() {
        return quality;
    }

    public void setQuality(byte quality) {
        this.quality = quality;
    }

    public EquipType getEquipType() {
        if (kind == 1) {
            return EquipType.Weapon;
        } else if (kind == 2) {
            return EquipType.Clothes;
        } else if (kind == 3) {
            return EquipType.Ring;
        } else {
            return EquipType.Shoe;
        }
    }

    public AttributeType getAttributeType(){
        if (kind == 1) {
            return AttributeType.ATK;
        } else if (kind == 2) {
            return AttributeType.DEF;
        } else if (kind == 3) {
            return AttributeType.HP;
        } else {
            return AttributeType.RGS;
        }
    }
}
